﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using DeepEarth.Geometry;

namespace DeepMap.Controls
{
	public delegate void PushPinSelectedHandler(Point location, Size pushPinSize, bool isSelected, PointBase pushPin);


    public class Pushpin : PointBase
    {
        public event PushPinSelectedHandler PushPinSelected;
        public string Description { get; set; }
        public bool IsSelected { get; set; }

        //public Pushpin(GeometryLayer layer) : base(layer)
        public Pushpin()
        {
            Style = Application.Current.Resources["PushpinStyle"] as Style;
            MouseLeftButtonDown += Pushpin_MouseLeftButtonDown;
        }


        private void Pushpin_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (PushPinSelected != null)
                PushPinSelected(Point, _OriginalSize, IsSelected, this);

            IsSelected = !IsSelected;
        }

    }
}